<template>
    <div class="hr-jg">
      <Layout :style="{padding: '0 24px 24px'}">
        <Breadcrumb :style="{margin: '24px 0'}">
          <BreadcrumbItem><a href="javascript:void(0)" @click="jump('/index')">首页</a></BreadcrumbItem>
          <BreadcrumbItem>人力资源管理</BreadcrumbItem>
          <BreadcrumbItem>组织管理</BreadcrumbItem>
          <BreadcrumbItem>组织架构</BreadcrumbItem>
        </Breadcrumb>
        <Content :style="{padding: '24px', minHeight: '280px', background: '#fff'}">
          <div class="content">
            <div id="mountNode">
            </div>
          </div>
        </Content>
      </Layout>
    </div>
</template>

<script>
  import {init} from '../../utils/g6Utils';
  export default {
        name: "hr-jg",
        data() {
            return {
            }
        },
        methods: {
        },
        mounted() {
          const data = {
            nodes: [
              {
                shape:'root',
                id: 'n1',
                name:'董事长',
                label:'邓宁波'
              },
              {
                shape:'node',
                id: 'n2',
                name:'总经理',
                label:'卜小凤'
              },
              {
                shape:'node',
                id: 'n3',
                name:'业务经理',
                label:'张勇'
              },
              {
                shape:'node',
                id: 'n4',
                name:'财务经理',
                label:'邓强'
              },
              {
                shape:'node',
                id: 'n5',
                name:'人事经理',
                label:'胡霞'
              },
              {
                shape:'node',
                id: 'n6',
                name:'数控工人',
                label:'王丹妮'
              },
              {
                shape:'node',
                id: 'n7',
                name:'电焊工',
                label:'王能'
              },
              {
                shape:'node',
                id: 'n8',
                name:'电焊工',
                label:'邱波'
              },
              {
                shape:'node',
                id: 'n9',
                name:'会计',
                label:'王贺'
              },
              {
                shape:'node',
                id: 'n10',
                name:'会计',
                label:'谢青'
              },
              {
                shape:'node',
                id: 'n11',
                name:'会计',
                label:'兰芳'
              },
              {
                shape:'node',
                id: 'n12',
                name:'普通员工',
                label:'何丽'
              },
              {
                shape:'node',
                id: 'n13',
                name:'普通员工',
                label:'赵迪'
              },
            ],
            edges: [
              {
                source:'n1',
                target: 'n2',
              },
              {
                source:'n2',
                target: 'n3',
              },
              {
                source:'n2',
                target: 'n4',
              },
              {
                source:'n2',
                target: 'n5',
              },
              {
                source:'n3',
                target: 'n6',
              },
              {
                source:'n3',
                target: 'n7',
              },
              {
                source:'n3',
                target: 'n8',
              },
              {
                source:'n4',
                target: 'n9',
              },
              {
                source:'n4',
                target: 'n10',
              },
              {
                source:'n4',
                target: 'n11',
              },
              {
                source:'n5',
                target: 'n12',
              },
              {
                source:'n5',
                target: 'n13',
              },
            ],
            groups:[
            ],
          };
          let divDom=document.getElementById('mountNode');
          init('mountNode',divDom.offsetWidth,divDom.offsetHeight,data);
        }
    }
</script>

<style lang="css" scoped>

</style>
